package anji.plus.system.mark.vo;

import anji.plus.system.mark.domain.AccountRecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class DateRecords extends TotalRecords implements Serializable {


    /**
     * 创建时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime createTime;


    /**
     * 资金池当日总收入
     */

    private Double income;

    /**
     * 资金池当日总支出
     */
    private Double exp;

    /**
     * 节点信息list
     */
    private List<RecordItem> nodeList;

    public Double getIncome(){
        if(this.income == null){
            return  0.00;
        }
        return income;
    }

    public Double getExp(){
        if(this.exp == null){
            return  0.00;
        }
        return exp;
    }
}
